package com.museum.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper;
import com.museum.entity.Wordentry;
import com.museum.mapper.WordentryMapper;
import com.museum.service.IWordentryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Akihi
 * @since 2022-12-09
 */
@Service
public class WordentryServiceImpl extends ServiceImpl<WordentryMapper, Wordentry> implements IWordentryService {
    /*根据ids查询多个音频文件名*/
    @Override
    public List<String> getHakkaPronunciationsByIds(Long[] ids) {
        List<Wordentry> wordentryList = listByIds(Arrays.asList(ids));
        List<String> keys = new ArrayList<>();
        for (Wordentry wordentry : wordentryList) {
            keys.add(wordentry.getHakkaPronunciation());
        }
        return keys;
    }
}
